home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-18 | 3.9 KB | 147 lines |
- /*
- * @(#)ISAPIConnection.java 1.10 97/05/11
- *
- * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- * CopyrightVersion 1.0
- */
-
- package sun.servlet.isapi;
-
- import java.io.IOException;
-
- /**
- * This class represents an ISAPI connection for the servlet runner.
- *
- * @version 1.10, 05/11/97
- * @author David Connelly
- * @author Jongyoon Lee
- */
- class ISAPIConnection {
- /*
- * The C data for this ISAPI request.
- */
- private long ecb;
-
- /*
- * Initializes the connection for the specified ECB data.
- * @param ecb pointer to ExtensionControlBlock
- */
- void init(long ecb) {
- this.ecb = ecb;
- }
-
- /*
- * Resets the connection for a new request.
- */
- void reset() {
- ecb = -1;
- }
-
- /*
- * Sets the status code.
- * @param status the status code
- */
- native void setStatusCode(long status);
-
- /*
- * Returns the request method.
- */
- native String getMethod();
-
- /*
- * Returns the query string or null if none.
- */
- native String getQueryString();
-
- /*
- * Returns the path info or null if none.
- */
- native String getPathInfo();
-
- /*
- * Returns the translated path.
- */
- native String getPathTranslated();
-
- /*
- * Returns the content type or null if not known.
- */
- native String getContentType();
-
- /*
- * Returns the virtual path translated to the real path.
- * @param vpath the virtual path
- */
- native String getRealPath(String vpath);
-
- /*
- * Returns the value of the specified server variable, or null if not
- * found.
- * @param name name of the server variable
- */
- native String getServerVariable(String name);
-
- /*
- * Sends redirect URL.
- * @param url the new url for redirection
- */
- native void sendRedirect(String url);
-
- /*
- * Gets the data from ECB
- * @param start indicates starting position within lpbData member
- * @param buf byte array to return data
- * @param off start position of the buf
- * @param buflen number of bytes available in buf
- */
- native long getData(long start, byte[] buf, long off, long buflen);
-
- /*
- * Writes the headers and status messages.
- * @param status buffer that contains status message string
- * @param soff offset of status buffer
- * @param slen length of status buffer
- * @param headers buffer that contains headers
- * @param hoff offset of header buffer
- * @param hlen length of header buffer
- */
- native void writeHeaders(byte[] status, long soff, long slen,
- byte[] headers, long hoff, long hlen);
-
- /*
- * Reads from the client into the specified byte array. Returns -1 if
- * no more bytes are available.
- * @param b buffer to which read the data
- * @param off offset of the buffer
- * @param len length of the buffer
- */
- native long readClient(byte[] b, long off, long len) throws IOException;
-
- /*
- * Writes the specified bytes to the client.
- * @param b buffer that contains outgoing message
- * @param off offset of the buffer
- * @param len length of the buffer
- */
- native void writeClient(byte[] b, long off, long len) throws IOException;
-
- /*
- * Informs the server that the operation has finished
- */
- native void finish();
- }
-